package com.stlm2.dems.user.entity;

/**
 * Created by apple on 2017/8/23.
 */
public enum UserLevel {

    Silver(1) {
        public String toString() {
            return "消费商";
        }
    },
    Gold(2) {
        public String toString() {
            return "合伙人";
        }
    };

    private final int val;

    UserLevel(int n) {
        val = n;
    }

    public int getIntValue() {
        return val;
    }

    public static UserLevel getByIntValue(int n) {
        switch (n) {
            case 1:
                return Silver;
            case 2:
                return Gold;
            default:
                return null;
        }
    }
}
